<template>
    <view>
        <!-- parse <template is="searchTpl" :data="cacheName,hisKeys,returnUrl,search,type"/> -->
        <block name="searchTpl">
            <view class="main main-search">
                <view class="bar search bg-white">
                    <view class="search-form round">
                        <text class="icon-search"></text>
                        <input type="text" v-model="search" placeholder="请输入搜索内容" confirm-type="search" @confirm="bindSearchConfirm" maxlength="20" />
                        <text v-if="search.length > 0" @tap="bindClearKeyTap" class="icon-roundclosefill text-l text-gray clear"></text>
                    </view>
                    <view class="action">
                        <button @tap="url" data-type="back" class="btn bg-project text-white shadow-blur round">返回</button>
                    </view>
                </view>

                <view class="his">
                    <view class="title">
                        <view class="tit">历史记录</view>
                        <text @tap="bindDelHisTap" class="del text-small icon-delete"></text>
                    </view>

                    <view class="search-content">
                        <view @tap="bindKeyTap" :data-key="item" class="btn mid round text-darkgreen" v-for="(item, index) in hisKeys" :key="index">{{ item }}</view>
                    </view>
                </view>
            </view>
        </block>
    </view>
</template>

<script>
let behavior = require('../../../behavior/search_bh.js');
let PassortBiz = require('../../../biz/passport_biz.js');
let skin = require('../skin/skin.js');
export default {
    data() {
        return {
            search: '',
            hisKeys: []
        };
    },
    mixins: [behavior],
    onReady: function () {
        PassortBiz.initPage({
            skin,
            that: this
        });
    },
    methods: {
        bindSearchConfirm() {
            console.log('占位：函数 bindSearchConfirm 未声明');
        },

        bindClearKeyTap() {
            console.log('占位：函数 bindClearKeyTap 未声明');
        },

        url() {
            console.log('占位：函数 url 未声明');
        },

        bindDelHisTap() {
            console.log('占位：函数 bindDelHisTap 未声明');
        },

        bindKeyTap() {
            console.log('占位：函数 bindKeyTap 未声明');
        }
    }
};
</script>
<style>
@import './search.css';
@import 'undefined';
</style>
